<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Get_ips extends CI_Controller {
    const ERROR_TAB     = 'error';
    public function __construct(){
        parent::__construct();
        $this->load->library('error_code_library');
        $this->load->database();
    }

    public function index(){
    	echo "183.135.250.10:15000";exit;
        $this->load->model('universal/Mobility_ip_model');
        $ip_num = $this->uri->segment(3) ? $this->uri->segment(3) : 10;
        $ips = $this->Mobility_ip_model->get_all_mobility_ips($ip_num);
        //var_dump($ip);
        if(FALSE === array_key_exists(self::ERROR_TAB, $ips)) {
            $ip_str = '';
            foreach($ips as $val){
                if($ip_str) $ip_str .= '|';
                $ip_str .= $val['ip'].":".$val['port'];
            }
            echo $ip_str;
        }
	}
	
	public function main(){
		$this->load->model('universal/Mobility_ip_model');
		$ip_num = $this->uri->segment(3) ? $this->uri->segment(3) : 10;
		$ips = $this->Mobility_ip_model->get_all_mobility_ips($ip_num);
		//var_dump($ip);
		if(FALSE === array_key_exists(self::ERROR_TAB, $ips)) {
			$ip_str = '';
			foreach($ips as $val){
				if($ip_str) $ip_str .= '|';
				$ip_str .= $val['ip'].":".$val['port'];
			}
			echo $ip_str;
		}
	}
}
